<template>
	<view class="jobProgressCard" @click="toJobProgressDetail()">
		<view class="firstRow">
			<span>{{jobInfo.postTitle}}</span>
			<span>{{jobInfo.priceDesc}}</span>
		</view>
		<view class="secondRow">
			<span>距我{{distance}}km&nbsp;|&nbsp;{{jobInfo.locationDesc}}</span>
		</view>
		<view class="status" style="color: #FF5F58;">
			<image src="@/subpageA/static/img/my_slices/jobProgress/cancelled.png" mode="scaleToFill"></image>
			<span>{{jobInfo.statusDesc}}</span>
		</view>
		<!-- <view class="status" v-if="jobInfo.status===2"
		style="color: #FF5F58;">
			<img src="@/subpageA/static/img/my_slices/jobProgress/notAdmitted.png" alt="">
			<span>未录取</span>
		</view>
		<view class="status" v-if="jobInfo.status===3"
		style="color: #08B1C8;">
			<img src="@/subpageA/static/img/my_slices/jobProgress/yipingjia.png" alt="">
			<span>已评价</span>
		</view>
		<view class="status" v-if="jobInfo.status===4"
		style="color: #08C89A;">
			<img src="@/subpageA/static/img/my_slices/jobProgress/yijiesuan.png" alt="">
			<span>已结算</span>
		</view>
		<view class="status" v-if="jobInfo.status===5"
		style="color: #FFA858;">
			<img src="@/subpageA/static/img/my_slices/jobProgress/toBeAdmit.png" alt="">
			<span>待录取</span>
		</view>
		<view class="status" v-if="jobInfo.status===6"
		style="color: #08C89A;">
			<img src="@/subpageA/static/img/my_slices/jobProgress/yiluqu.png" alt="">
			<span>已录取</span> 
		</view>-->
		
		<button>相似推荐</button>
	</view>
</template>

<script>
	import {getFlatternDistance} from '@/common/getFlatternDistance.js'
	export default {
		name:"jobProgressCard",
		data() {
			return {
				jobName:'服务员',
				number:100,
				distance:2.17,
				address:'保利大都汇',
				status:6, //职位进展状态：已取消-1，未录取-2，已评价-3，已结算-4，待录取-5，已录取-6
			};
		},
		props:{
			jobInfo:{
				type:Object,
				default:{}
			}
		},
		created() {
			var location = this.jobInfo.location.split(',')
			this.distance = getFlatternDistance(location[1],location[0])
		},
		methods:{
			toJobProgressDetail(){
				this.$store.state.currentPostId = this.jobInfo.postId
				let temp={
					postId:this.jobInfo.postId,
					enrollId:this.jobInfo.enrollId
				}
				uni.navigateTo({
					url:'./jobProgressDetail?data='+JSON.stringify(temp)
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.jobProgressCard{
		width: 622rpx;
		margin: 32rpx 32rpx 0;
		padding: 32rpx;
		background: #FFFFFF;
		border-radius: 16rpx;
		
		.firstRow{
			width: 100%;
			>span:nth-of-type(1){
				font-size: 14px;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
				color: #001A18;
			}
			>span:nth-of-type(2){
				float: right;
				font-size: 24rpx;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
				color: #FF5F58;
				>span{
					font-size: 28rpx;
				}
			}
		}
		
		.secondRow{
			>span{
				font-size: 12px;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #505E5C;
			}
		}
		
		.status{
			margin-top: 24rpx;
			width: 100%;
			image{
				width: 36rpx;
				height: 36rpx;
				margin-right: 6rpx;
				vertical-align: -8rpx;
			}
			>span{
				font-size: 14px;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
			}
		}
		
		button{
			float: right;
			display: flex;
			justify-content: center;
			align-items: center;
			transform: translate(0,-64rpx);
			width: 176rpx;
			height: 64rpx;
			background: #F3F7F8;
			border-radius: 12rpx;
			font-size: 14px;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #001A18;
		}
	}
</style>